#pragma once
#include "isession.h"
#include "ipport.h"
#include "inetthread.h"

class Session:public ISession
{
public:
	Session(SESSIONID sessionId,SOCKID sockId,const IpPort& ipPort,INetThread* pNetThread)
	:m_sessionId(sessionId),m_sockId(sockId),m_ipPort(ipPort),m_netThread(pNetThread){}
	virtual ~Session() {}

	bool SendData(const char* data, const DATA_LENGTH_TYPE length) override {
		return m_netThread->SendMessage(data,length,m_sessionId);
	}
	const SESSIONID GetSessionId() {
		return m_sessionId;
	}
	const SOCKID GetSockId() {
		return m_sockId;
	}
	const IpPort& GetIpPort() {
		return m_ipPort;
	}

protected:
	SESSIONID m_sessionId;
	SOCKID m_sockId;
	IpPort m_ipPort;
	INetThread* m_netThread;
};
